package com.interclass;

/**
 * @Auther: shiquan
 * @Date: 2024/10/22 - 10 - 22 -16:41
 */
public class Car {
    /*
    内部类可以直接访问外部类的成员 包括私有
    外部类访问内部类成员  必须要创建对象
     */

    String carName;
    int carAge;
    String carcolor;

    public void show(){
        Engine e = new Engine();

        System.out.println(this.carName);
        System.out.println(e.engineName);
    }

    class Engine{
        String engineName;
        int engineAge;

        public void show(){
            System.out.println(engineName);
            System.out.println(carName);
        }
    }

}
